package com.pw.tool.patterns.simplepattern;

public class FactoryPatternDemo {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();

        // 获取 Circle 对象，并调用它的 draw 方法
        Shape shape1 = shapeFactory.getShape("CIRCLE");
        shape1.draw();

        // 获取 Square 对象，并调用它的 draw 方法
        Shape shape2 = shapeFactory.getShape("SQUARE");
        shape2.draw();

        // 获取 Rectangle 对象，并调用它的 draw 方法
        Shape shape3 = shapeFactory.getShape("RECTANGLE");
        shape3.draw();
    }
}
